﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Net.Browser;

namespace DXTools.Core.Service
{

    public class AtomRequestCreator
    {
        #region AtomRequestCreator Members

        public WebRequest CreateGET(Uri requestUri)
        {
            WebRequest.RegisterPrefix(requestUri.OriginalString, WebRequestCreator.ClientHttp);
            HttpWebRequest getRequest = WebRequest.Create(requestUri) as HttpWebRequest;
            getRequest.Accept = "application/atom+xml, */*";
            return getRequest;
        }

        public WebRequest CreateGETWithBrowserHttp(Uri requestUri)
        {
            WebRequest.RegisterPrefix(requestUri.OriginalString, WebRequestCreator.BrowserHttp);
            HttpWebRequest getRequest = WebRequest.Create(requestUri) as HttpWebRequest;
            return getRequest;
        }

        #endregion
    }

    public class JSONRequestCreator
    {
        #region JSONRequestCreator Members

        public WebRequest CreateGET(Uri requestUri)
        {
            WebRequest.RegisterPrefix(requestUri.OriginalString, WebRequestCreator.ClientHttp);
            HttpWebRequest getRequest = WebRequest.Create(requestUri) as HttpWebRequest;
            getRequest.Accept = "application/json, text/javascript, */*";

            return getRequest;
        }

        #endregion
    }
}
